#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
int main()
{
    pid_t id = fork();
    if (id == 0)
    {
        char* const argv[] = {
            "ls",
            "-a",
            "-l",
            NULL
        };
        //execl("/usr/bin/ls", "ls", "-a", "-l", NULL);
        //execlp("ls", "ls", "-a", "-l", NULL);
        //execv("/usr/bin/ls", argv);
        execvp("ls", argv);
        printf("child process exit\n");
    }
    else 
    {
        waitpid(id, NULL, 0);
        printf("ls command call success\n");
    }

    return 0;
}
